
import random
i = 0
lst = []
#print(random.choice([0, 1]))
while i <= 11:
    a = random.choice([0, 1])
    lst.append(a)  #lst.append没有返回值  错误写法：lst = lst.append(a)
    i = i+1
print(lst)
print("1表示灯亮，0表示不亮")
print("如果打到亮的灯，true")
random_num = random.randint(0, 11)
if lst[random_num] == 1:
    print(f"恭喜打中了第{random_num+1}亮的灯")
    print("true")
else:
    print(f"抱歉，你打中了第{random_num+1}个灯，但灯并不亮")






